]> git.pld-linux.org Git - packages/mysql-connector-c++.git/blob - mysql-connector-c++.spec
- x32 rebuild
[packages/mysql-connector-c++.git] / mysql-connector-c++.spec
1 #
2 # Conditional build:
3 %bcond_without  static_libs     # don't build static libraries
4 %bcond_with             tests           # skip tests
5
6 Summary:        MySQL database connector for C++
7 Name:           mysql-connector-c++
8 Version:        1.1.1
9 Release:        2
10 License:        GPL v2 with exceptions
11 Group:          Libraries
12 URL:            http://forge.mysql.com/wiki/Connector_C++
13 Source0:        http://vesta.informatik.rwth-aachen.de/mysql/Downloads/Connector-C++/%{name}-%{version}.tar.gz
14 # Source0-md5:  3f3134ac39a5d56fdd360f2ad0121a99
15 Source1:        get-source.sh
16 # Source0Download: http://dev.mysql.com/downloads/connector/cpp
17 BuildRequires:  boost-devel >= 1.34.0
18 BuildRequires:  cmake >= 2.6.2
19 BuildRequires:  libstdc++-devel
20 BuildRequires:  mysql-devel
21 BuildRequires:  sed >= 4.0
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %description
25 MySQL Connector/C++ is a MySQL database connector for C++.
26
27 The MySQL Driver for C++ mimics the JDBC 4.0 API. However,
28 Connector/C++ does not implement all of the JDBC 4.0 API.
29
30 The Connector/C++ preview features the following classes:
31 - Connection
32 - DatabaseMetaData
33 - Driver
34 - PreparedStatement
35 - ResultSet
36 - ResultSetMetaData
37 - Savepoint
38 - Statement
39
40 %package devel
41 Summary:        MySQL Connector/C++ developer files (headers, examples, etc.)
42 Group:          Development/Libraries
43 Requires:       %{name} = %{version}-%{release}
44 Requires:       mysql-devel
45
46 %description devel
47 These are the files needed to compile programs using MySQL
48 Connector/C++.
49
50 %package static
51 Summary:        Static mysqlcppconn library
52 Summary(pl.UTF-8):      Statyczna biblioteka mysqlcppconn
53 Group:          Development/Libraries
54 Requires:       %{name}-devel = %{version}-%{release}
55
56 %description static
57 Static mysqlcppconn library.
58
59 %description static -l pl.UTF-8
60 Statyczna biblioteka mysqlcppconn.
61
62 %prep
63 %setup -q
64 %{__sed} -i -e 's/lib$/%{_lib}/' driver/CMakeLists.txt
65 %{__chmod} -x examples/*.cpp examples/*.txt
66
67 %if %{without tests}
68 %{__sed} -i -e '/ADD_SUBDIRECTORY.*test/d' CMakeLists.txt
69 %endif
70
71 # Save examples to keep directory clean (for doc)
72 %{__mkdir} _doc_examples
73 %{__cp} -pr examples _doc_examples
74
75 %build
76 # MYSQLCLIENT_STATIC_BINDING controls whether libmysqlclient is linked or dlopened
77 %cmake \
78         -DMYSQLCPPCONN_BUILD_EXAMPLES:BOOL=0 \
79         -DMYSQLCLIENT_STATIC_BINDING:BOOL=1
80 %{__make}
81
82 %if %{with tests}
83 # for documentation purpose only (A MySQL server is required)
84 # cd test
85 # ./static_test tcp://127.0.0.1 user password test_database
86 # Should output : Loops= 2 Tests=  592 Failures=   0
87 # ./driver_test tcp://127.0.0.1 user password test_database
88 # Should output :  Loops= 2 Tests=  592 Failures=   0
89 %endif
90
91 %install
92 rm -rf $RPM_BUILD_ROOT
93 %{__make} install \
94         DESTDIR=$RPM_BUILD_ROOT
95
96 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
97 cp -a _doc_examples/examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
98
99 rm $RPM_BUILD_ROOT%{_prefix}/{COPYING,README,INSTALL,ANNOUNCEMENT,Licenses_for_Third-Party_Components.txt}
100
101 %clean
102 rm -rf $RPM_BUILD_ROOT
103
104 %post   -p /sbin/ldconfig
105 %postun -p /sbin/ldconfig
106
107 %files
108 %defattr(644,root,root,755)
109 %doc ANNOUNCEMEN* COPYING README CHANGES Licenses_for_Third-Party_Components.txt
110 %attr(755,root,root) %{_libdir}/libmysqlcppconn.so.*.*.*
111 %ghost %{_libdir}/libmysqlcppconn.so.6
112
113 %files devel
114 %defattr(644,root,root,755)
115 %{_libdir}/libmysqlcppconn.so
116 %{_includedir}/mysql_connection.h
117 %{_includedir}/mysql_driver.h
118 %{_includedir}/cppconn
119 %{_examplesdir}/%{name}-%{version}
120
121 %if %{with static_libs}
122 %files static
123 %defattr(644,root,root,755)
124 %{_libdir}/libmysqlcppconn-static.a
125 %endif
This page took 0.068307 seconds and 3 git commands to generate.